/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================
*/

#ifndef Omen_KEYBOARD_EVENT_H
#define Omen_KEYBOARD_EVENT_H

#include "OmenConfig.h"
#include "IOmenEvent.h"
#include "OmenDataTypes.h"

namespace Omen {

    class KeyboardEvent : public Omen::Event
    {
    public:
        /////////////////////// Virtual KeyCodes /////////////////////// 
        static const BYTE Key_ESC = 27;
        /////////////////////// ~Virtual KeyCodes~ /////////////////////// 

        OMEN_API KeyboardEvent( long button ) : m_button(button) { if( button > 0 )m_buttonStates[button] = 1; else m_buttonStates[-button] = 0;};
        OMEN_API virtual ~KeyboardEvent() {};

        OMEN_API unsigned long button() const { return m_button; }
        OMEN_API BYTE* buttons() const { return (BYTE*)&m_buttonStates; }
        OMEN_API void setButtons( BYTE* buttons ) { memcpy(m_buttonStates, buttons, 256);}

        OMEN_API static void initialize() { memset( m_buttonStates, 0, 256*sizeof(BYTE) ); }
    
    private:
        #pragma warning(disable:4251) // Disable warning about private member variable needs to have dll-interface to be used by clients of class 'this'
        unsigned long   m_button;
        static BYTE     m_buttonStates[256];
        #pragma warning(default:4251)
        
    };
} // Omen

#endif // Omen_KEYBOARD_EVENT_H
